#include"SList.h"

//void Test1()
//{
//	SLTNode* node1 = (SLTNode*)malloc(sizeof(SLTNode));
//	node1->data = 1;
//	SLTNode* node2 = (SLTNode*)malloc(sizeof(SLTNode));
//	node2->data = 2;
//	SLTNode* node3 = (SLTNode*)malloc(sizeof(SLTNode));
//	node3->data = 3;
//	SLTNode* node4 = (SLTNode*)malloc(sizeof(SLTNode));
//	node4->data = 4;
//
//	node1->next = node2;
//	node2->next = node3;
//	node3->next = node4;
//	node4->next = NULL;
//
//	SLTNode* plist = node1;
//	SLTPrint(plist);
//}

int main()
{
	//Test1();
	SLTNode* plist = NULL; // 结构体指针
	SLTPushBack(&plist, 1); 
	SLTPushBack(&plist, 2);
	SLTPushBack(&plist, 3);
	SLTPrint(plist);
	/*SLTPushFront(&plist, 4);
	SLTPushFront(&plist, 5);
	SLTPushFront(&plist, 6);
	SLTPrint(plist);*/

	/*SLTPopBack(&plist);
	SLTPopBack(&plist);
	SLTPopBack(&plist);
	SLTPopBack(&plist);
	SLTPrint(plist);*/

	/*SLTPopFront(&plist);
	SLTPopFront(&plist);
	SLTPopFront(&plist);
	SLTPrint(plist);*/

	/*SLTNode* find = SLTFind(&plist, 0);
	if (find)
	{
		printf("找到了！\n");
	}
	else
	{
		printf("未找到！\n");
	}*/

	/*SLTNode* find = SLTFind(&plist, 1);
	SLTInsert(&plist, find, 100);
	SLTPrint(plist);*/

	/*SLTNode* find = SLTFind(&plist, 3);
	SLTInsertAfter(find, 100);
	SLTPrint(plist);*/
	
	//SLTNode* find = SLTFind(&plist, 2);
	//SLTErase(&plist, find);
	
	/*SLTNode* find = SLTFind(&plist, 2);
	SLTEraseAfter(find);
	SLTPrint(plist);*/

	SListDesTroy(&plist);

	return 0;
}